import Vue from 'vue'
import Router from 'vue-router'

//  新增人物
const Home = resolve => require(['../components/page/Index.vue'], resolve);

//  健康档案 一
const HealthBase = resolve => require(['../components/page/health_records/HealthBase.vue'], resolve);
const HealthBaseNext = resolve => require(['../components/page/health_records/HealthBaseNext.vue'], resolve);  //  下一步


//  数据监测  模块
const DataMonitor = resolve => require(['../components/page/data_monitoring/DataMonitor.vue'], resolve);
//  添加新数据  压力
const AddPressure = resolve => require(['../components/page/data_monitoring/sonpage/AddPressure.vue'], resolve);
//  添加新数据  血糖
const AddSugar = resolve => require(['../components/page/data_monitoring/sonpage/AddSugar.vue'], resolve);
//  添加新数据   体重
const AddWeight = resolve => require(['../components/page/data_monitoring/sonpage/AddWeight.vue'], resolve);


//  健康病历 模块
const Case = resolve => require(['../components/page/medical_record/Case.vue'], resolve);
//  添加病历
const Addcase = resolve => require(['../components/page/medical_record/addcase/Addcase.vue'], resolve);
//  查看病历
const CaseEdit = resolve => require(['../components/page/medical_record/CaseEdit.vue'], resolve);

//  改善方案 模块
const Improve = resolve => require(['../components/page/improvement_scheme/improve.vue'], resolve);

//  <-- 子模块-- >
//  干预方案 、、 、 、 、 、 、、、、、、、、、、、、、、、、、、、、干预方案、、、、、、、、、、、、、、、、、、、、、、、、、、、、、干预方案、、、、、、 、、、、、、、、、、、//
//  医疗建议
const HealthImprove = resolve => require(['../components/page/improvement_scheme/intervention_program/HealthImprove.vue'], resolve);
//  监测指导
const Monitor = resolve => require(['../components/page/improvement_scheme/intervention_program/Monitor.vue'], resolve);
// 就诊指导
const Visit = resolve => require(['../components/page/improvement_scheme/intervention_program/Visit.vue'], resolve);
//  复查指导
const Review = resolve => require(['../components/page/improvement_scheme/intervention_program/Review.vue'], resolve);

//  改善建议 、、 、 、 、 、 、、、、、、、、、、、、、、、、、、、、改善建议、、、、、、、、、、、、、、、、、、、、、、、、、、、、、改善建议、、、、、、 、、、、、、、、、、、//
//  饮食指导
const Diet = resolve => require(['../components/page/improvement_scheme/advise/Diet.vue'], resolve);
//  早餐详情
//const Breakfast = resolve => require(['../components/page/improvement_scheme/advise/dietCom/Breakfast.vue'], resolve);
import Breakfast from '../components/page/improvement_scheme/advise/dietCom/Breakfast.vue'
//  中餐详情 
//const Chinesefood = resolve => require(['../components/page/improvement_scheme/advise/dietCom/Chinesefood.vue'], resolve);
import Chinesefood from '../components/page/improvement_scheme/advise/dietCom/Chinesefood.vue'
// 晚餐详情
//const Dinner = resolve => require(['../components/page/improvement_scheme/advise/dietCom/Dinner.vue'], resolve);
import Dinner from '../components/page/improvement_scheme/advise/dietCom/Dinner.vue'
//<-- 子模块-- >
//  运动指导
const Motion = resolve => require(['../components/page/improvement_scheme/advise/Motion.vue'], resolve);
//  心理指导
const Psychology = resolve => require(['../components/page/improvement_scheme/advise/Psychology.vue'], resolve);
//  睡眠指导
const Sleep = resolve => require(['../components/page/improvement_scheme/advise/Sleep.vue'], resolve);


Vue.use(Router)

export default new Router({
	mode: 'history',
	base: '/health/',
	routes: [
		{
			path: '/addperson',
			component: Home
		},
		//  健康档案 模块
		{
			path: '/healthbase',
			component: HealthBase,
			children: [
				{path: 'next/:id', component: HealthBaseNext}
			]
		},
		//  数据监测 模块
		{
			path: '/datamonitor',
			component: DataMonitor,
			meta: { datamonitor: '数据监测' },
			children:[
				{path: 'addpre', component: AddPressure},
				{path: 'addsugar', component: AddSugar},
				{path: 'addweight', component: AddWeight}
			]
		},
		//  健康病历模块
		{
			path: '/case',
			component: Case,
			children:[
				{path: 'addcase', component: Addcase},
				{path: 'edit/:id', component: CaseEdit}
			]
		},
		// 改善管理 模块
		{
			path: '/improve',
			component: Improve,
			children:[
				{path: 'health', component: HealthImprove},  //  医疗建议
				{path: 'monitor', component: Monitor}, // 监测指导
				{path: 'visit', component: Visit},    //  就诊指导
				{path: 'review', component: Review},  //  复查指导
				{
					path: 'diet', 
					component: Diet,
					children: [
						{path: 'breakfast', component: Breakfast}, // 早餐详情
						{path: 'chinesefood', component: Chinesefood}, // 中餐详情
						{path: 'dinner', component: Dinner} // 晚餐详情
					]
				},  //  饮食指导
				{path: 'motion', component: Motion},  //  运动指导
				{path: 'psychology', component: Psychology},  //  心理指导
				{path: 'sleep', component: Sleep},  //  睡眠指导
			]
		},
		{
	      path: '/',
	      redirect: '/datamonitor'
	      
	    },
	    {
			path: '/',
			component: DataMonitor
		},
	    { 
	    	path: "*", 
	    	redirect: '/addperson' 
	    }
	]
})